Auto merge of #5319 - matklad:fix-profiler, r=Eh2406
authorbors <bors@rust-lang.org>
Sun, 8 Apr 2018 15:21:20 +0000 (15:21 +0000)
committerbors <bors@rust-lang.org>
Sun, 8 Apr 2018 15:21:20 +0000 (15:21 +0000)
commit9a566608d0655321655def7bc2239dbc1b9870c1
treefd914455329055c9bc0144ba603a9678ac7a1f29
parent681756252b718c4e638b3b8004bdc068b5529ae3
parent154948837afbbfc312764b24982ba7dbac0d4ebd
Auto merge of #5319 - matklad:fix-profiler, r=Eh2406

Don't print profiling information twice

It's important to `.clear` the messages so that we don't print them
again for the next "profiling session". It might be argued that really
we should have a single "profiling session" for Cargo, but we don't at
the moment.

And, while we are at it, let's lock stdout as well, so that we won't
get confused when Cargo becomes multi-threaded and prints profiling info
from several threads simultaneously.